﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.ApplicationServer.Http.Dispatcher;
using System.Net.Http;
using ApiPrototype.Models;
using Microsoft.ApplicationServer.Http.Description;

namespace ApiPrototype.Handlers
{
    public class EFContextOperationHandler : HttpOperationHandler
    {
        public EFContextOperationHandler() : base() { }

        protected override IEnumerable<HttpParameter> OnGetInputParameters()
        {
            yield return new HttpParameter("request", typeof(HttpRequestMessage));
        }

        protected override IEnumerable<HttpParameter> OnGetOutputParameters()
        {
            yield return new HttpParameter("ctx", typeof(iphlEntities)) { IsContentParameter = false };
        }

        protected override object[] OnHandle(object[] input)
        {
            return new object[1] { new iphlEntities() };
        }
    }
}
